package smash_tris;

public class TetrisPiece extends Grid {

	static Grid pieces[] = new Grid[7];
	
	public TetrisPiece(int i) {
		super(pieces[i]);
	}

	public TetrisPiece() {
		this((int) (Math.random() * 7.0));
	}

	public TetrisPiece(TetrisPiece p) {
		super(p);
	}
	
	static {
		pieces[0] = new Grid(3, 2);
		pieces[0].grid[0][0] = 0;
		pieces[0].grid[1][0] = 1;
		pieces[0].grid[2][0] = 0;
		pieces[0].grid[0][1] = 1;
		pieces[0].grid[1][1] = 1;
		pieces[0].grid[2][1] = 1;


		pieces[1] = new Grid(2, 2);
		pieces[1].grid[0][0] = 2;
		pieces[1].grid[1][0] = 2;
		pieces[1].grid[0][1] = 2;
		pieces[1].grid[1][1] = 2;

		pieces[2] = new Grid(2, 3);
		pieces[2].grid[0][0] = 3;
		pieces[2].grid[1][0] = 0;
		pieces[2].grid[0][1] = 3;
		pieces[2].grid[1][1] = 3;
		pieces[2].grid[0][2] = 0;
		pieces[2].grid[1][2] = 3;


		pieces[3] = new Grid(2, 3);
		pieces[3].grid[0][0] = 0;
		pieces[3].grid[1][0] = 4;
		pieces[3].grid[0][1] = 4;
		pieces[3].grid[1][1] = 4;
		pieces[3].grid[0][2] = 4;
		pieces[3].grid[1][2] = 0;


		pieces[4] = new Grid(3, 2);
		pieces[4].grid[0][0] = 0;
		pieces[4].grid[1][0] = 0;
		pieces[4].grid[2][0] = 5;
		pieces[4].grid[0][1] = 5;
		pieces[4].grid[1][1] = 5;
		pieces[4].grid[2][1] = 5;


		pieces[5] = new Grid(3, 2);
		pieces[5].grid[0][0] = 6;
		pieces[5].grid[1][0] = 0;
		pieces[5].grid[2][0] = 0;
		pieces[5].grid[0][1] = 6;
		pieces[5].grid[1][1] = 6;
		pieces[5].grid[2][1] = 6;


		pieces[6] = new Grid(1, 4);
		pieces[6].grid[0][0] = 7;
		pieces[6].grid[0][1] = 7;
		pieces[6].grid[0][2] = 7;
		pieces[6].grid[0][3] = 7;

	}

}
